package cn.rubintry.bug.hunting.common.http.viewmodel

import androidx.activity.ComponentActivity
import androidx.lifecycle.MutableLiveData
import cn.rubintry.bug.hunting.common.http.api.WebApi
import cn.rubintry.bug.hunting.common.manager.UserManager
import cn.rubintry.bug.hunting.pojo.BaseModel
import cn.rubintry.bug.hunting.pojo.HistoryModel
import cn.rubintry.bug.lib.network.http.NetApiManager
import cn.rubintry.bug.lib.network.http.viewmodel.BaseViewModel

class HistoryViewModel() : BaseViewModel() {

    val historyData = MutableLiveData<BaseModel<List<HistoryModel>>>()

    fun getHistory(){
        request(
            NetApiManager.getInstance().getApi(WebApi::class.java),
            WebApi::getHistory,
            {
                historyData.value = it
            }, UserManager.getInstance().getUserData()?.detail?.id ?: "",
            UserManager.getInstance().getUserData()?.token ?: ""
        )
    }


}